package com.samsung.seleccion;

import com.samsung.actividades.Inicio;
import com.samsung.actividades.VistaParte;
import com.samsung.database.Orden;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class Codigo extends Activity{
	
	
	private Activity act;
	private Orden orden;
	
	public Codigo(Activity act) {
		this.act = act;
	}
	
	public Codigo(Activity act, Orden orden) {
		this.act = act;
		this.orden = orden;
	}
	public void sendActivity(String code){
		Intent intent;		
		
		intent = new Intent("com.samsung.actividades.VISTAPARTE");	
		if (orden != null){
			intent.putExtra(Inicio.KEY_ORDEN, orden);
		}
	//	intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    //    intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);

		// look into the bundle sent to VistaParte for data items        
		// create a container to ship data
		Bundle myData= new Bundle();
		// add <key,value> data items to the container
		myData.putString("val1", code);
		
        intent.putExtras(myData);
        act.startActivity(intent);
	}
	
	public void cod (String codigoHtml){
		String mcodigo = new String (codigoHtml);
		System.out.println("codigo: "+ mcodigo);
		Intent i = new Intent(act, VistaParte.class);
		i.putExtra( "CodigoParte", mcodigo );
		act.startActivity(i);
	}

}